<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set content type</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="httpresponse.setcontentdisposition.html">HttpResponse::setContentDisposition</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="httpresponse.setdata.html">HttpResponse::setData</a></div>
 <div class="up"><a href="class.httpresponse.html">HttpResponse</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="httpresponse.setcontenttype" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">HttpResponse::setContentType</h1>
  <p class="verinfo">(PECL pecl_http &gt;= 0.10.0)</p><p class="refpurpose"><span class="refname">HttpResponse::setContentType</span> &mdash; <span class="dc-title">Set content type</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-httpresponse.setcontenttype-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">static</span>
   <span class="type">bool</span> <span class="methodname"><strong>HttpResponse::setContentType</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$content_type</code></span>
   )</div>

  <p class="para rdfs-comment">
   Set the <em>Content-Type</em> of the sent entity.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-httpresponse.setcontenttype-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">content_type</code></em></dt>

     <dd>

      <p class="para">
       the content type of the sent entity (primary/secondary)
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-httpresponse.setcontenttype-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success, or <strong><code>FALSE</code></strong> if the content type does not seem to
   contain a primary and secondary content type part.
  </p>
 </div>


 

 


 


 <div class="refsect1 seealso" id="refsect1-httpresponse.setcontenttype-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="httpresponse.getcontentdisposition.html" class="methodname" rel="rdfs-seeAlso">HttpResponse::getContentDisposition()</a> - Get content disposition</span></li>
    <li class="member"><span class="methodname"><a href="httpresponse.setcontentdisposition.html" class="methodname" rel="rdfs-seeAlso">HttpResponse::setContentDisposition()</a> - Set content disposition</span></li>
    <li class="member"><span class="methodname"><a href="httpresponse.getcontenttype.html" class="methodname" rel="rdfs-seeAlso">HttpResponse::getContentType()</a> - Get content type</span></li>
    <li class="member"><span class="methodname"><a href="httpresponse.guesscontenttype.html" class="methodname" rel="rdfs-seeAlso">HttpResponse::guessContentType()</a> - Guess content type</span></li>
   </ul>
  </p>
 </div>



</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="httpresponse.setcontentdisposition.html">HttpResponse::setContentDisposition</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="httpresponse.setdata.html">HttpResponse::setData</a></div>
 <div class="up"><a href="class.httpresponse.html">HttpResponse</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
